package com.grape.dp.face.facade;

import com.grape.dp.face.service.IntegralService;
import com.grape.dp.face.service.LogService;
import com.grape.dp.face.service.MsgService;
import com.grape.dp.face.service.PaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Map;
/**
 * 描述:PayCallbackFacade
 * @author: myx
 * @date: 2019/7/29 0029
 * Copyright © 2019-grape. All rights reserved.
 */
@Component
public class PayCallbackFacade {
    @Autowired
    private LogService logService;
    @Autowired
    private PaymentService paymentService;
    @Autowired
    private IntegralService integralService;
    @Autowired
    private MsgService msgService;

    public boolean callbackFacade(Map<String, String> verifySignature) {
        //1.添加日志
        logService.logService(verifySignature);
        //2.更新支付状态
        paymentService.updatePaymentStatus();
        //3.添加积分
        integralService.callIntegral();
        //4.发送消息
        msgService.msgService();
        return true;
    }
}
